#include <stdio.h>

%% machine foo;
// write statement can appear before a machine is fully defined
%% write data;

int main(int argc, char** argv) {
    int cs, res = 0;
    if (argc > 1) {
        char *p = argv[1];
        %%{
            main :=
                [a-z]+
                0 @{ res += 1; fbreak;  }; # 0 can be ommitted ??
            write init; # if write init not added, compile passes but result is not right 
            write exec noend; # if noend is given, fbreak should be used to exit loop
        }%%
    }
    printf("execute = %i\n", res);
    return 0;
}
